package com.sgb.goods.entity;

import org.jetbrains.annotations.NotNull;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * 描述：商品-商品实体类
 *
 * @author qiangHeNooo
 * <p>
 * 时间：2020.10.29
 */
public class GoodsItemEntity implements Serializable {

    /**
     * brandId : 38
     * brandName : 屯鑫
     * fcatName : 水泥
     * fcategory : 6
     * num : 1
     * scatName : 散装水泥
     * scategory : 9
     * sort : 1
     * tcatName : 缓凝水泥
     * tcategory : 11
     * unit : 块
     */

    private String brandId;
    private String brandName;
    private String fcatName;
    private String fcategory;
    private String num;
    private String scatName;
    private String scategory;
    private String sort;
    private String tcatName;
    private String tcategory;
    private String unit;
    //是否有属性
    private boolean isHaveAttribute = true;
    private List<GoodsAttrEntity> attrList;

    public boolean isHaveAttribute() {
        return isHaveAttribute;
    }

    public void setHaveAttribute(boolean haveAttribute) {
        isHaveAttribute = haveAttribute;
    }

    public List<GoodsAttrEntity> getAttrList() {
        return attrList;
    }

    public void setAttrList(List<GoodsAttrEntity> attrList) {
        this.attrList = attrList;
    }

    public String getBrandId() {
        return brandId;
    }

    public void setBrandId(String brandId) {
        this.brandId = brandId;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public String getFcatName() {
        return fcatName;
    }

    public void setFcatName(String fcatName) {
        this.fcatName = fcatName;
    }

    public String getFcategory() {
        return fcategory;
    }

    public void setFcategory(String fcategory) {
        this.fcategory = fcategory;
    }

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public String getScatName() {
        return scatName;
    }

    public void setScatName(String scatName) {
        this.scatName = scatName;
    }

    public String getScategory() {
        return scategory;
    }

    public void setScategory(String scategory) {
        this.scategory = scategory;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public String getTcatName() {
        return tcatName;
    }

    public void setTcatName(String tcatName) {
        this.tcatName = tcatName;
    }

    public String getTcategory() {
        return tcategory;
    }

    public void setTcategory(String tcategory) {
        this.tcategory = tcategory;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    @Override
    public @NotNull String toString() {
        return "GoodsItem{" +
                "brandId='" + brandId + '\'' +
                ", brandName='" + brandName + '\'' +
                ", fcatName='" + fcatName + '\'' +
                ", fcategory='" + fcategory + '\'' +
                ", num='" + num + '\'' +
                ", scatName='" + scatName + '\'' +
                ", scategory='" + scategory + '\'' +
                ", sort='" + sort + '\'' +
                ", tcatName='" + tcatName + '\'' +
                ", tcategory='" + tcategory + '\'' +
                ", unit='" + unit + '\'' +
                ", attrList=" + attrList +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        GoodsItemEntity goodsItem = (GoodsItemEntity) o;
        return Objects.equals(brandId, goodsItem.brandId) &&
                Objects.equals(brandName, goodsItem.brandName) &&
                Objects.equals(fcatName, goodsItem.fcatName) &&
                Objects.equals(fcategory, goodsItem.fcategory) &&
                Objects.equals(num, goodsItem.num) &&
                Objects.equals(scatName, goodsItem.scatName) &&
                Objects.equals(scategory, goodsItem.scategory) &&
                Objects.equals(sort, goodsItem.sort) &&
                Objects.equals(tcatName, goodsItem.tcatName) &&
                Objects.equals(tcategory, goodsItem.tcategory) &&
                Objects.equals(unit, goodsItem.unit) &&
                Objects.equals(attrList, goodsItem.attrList);
    }

    @Override
    public int hashCode() {
        return Objects.hash(brandId, brandName, fcatName, fcategory, num, scatName, scategory, sort, tcatName, tcategory, unit, attrList);
    }
}
